package com.yuexun.dhdoctor.module.email.model.impl;


import com.yuexun.dhdoctor.module.email.api.UpdateApi;
import com.yuexun.dhdoctor.module.email.bean.SendBean;
import com.yuexun.dhdoctor.module.email.model.IUpdateModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2016/8/3.
 */
public class UpdateModel implements IUpdateModel {
    private UpdateApi api;

    //记录Log
//    privte final Logger log = ProUtil.getLogger(LoginModel.class);

    public UpdateApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(UpdateApi.class);
        }
    }

    @Override
    public Observable<SendBean> updatemail(Map<String, String> praise) {
        api = ApiInstance();
        return api.updateMail(praise);
    }
}
